package com.ruoyi.guestInfo.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 顾客信息表对象 wdm_guest
 * 
 * @author lql
 * @date 2025-05-04
 */
public class WdmGuest extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 顾客ID */
    private Long guestId;

    /** 微信OpenID */
    @Excel(name = "微信OpenID")
    private String openid;

    /** 微信UnionID（多应用统一标识） */
    @Excel(name = "微信UnionID", readConverterExp = "多=应用统一标识")
    private String unionid;

    /** 真实姓名（实名认证用） */
    @Excel(name = "真实姓名", readConverterExp = "实=名认证用")
    private String realName;

//    /** 手机号（11位数字） */
//    @Excel(name = "手机号", readConverterExp = "1=1位数字")
//    private String mobile;

    /** 手机号（11位数字） */
    @Excel(name = "手机号", readConverterExp = "11=位数字")
    @Pattern(regexp = "^(?:(?:\\+|00)86)?1(?:(?:3[0-9]|4[5-7]|5[0-35-9]|6[5-7]|7[0-8]|8[0-9]|9[1-8])\\d{8}|(?:48\\d{9}))$",
            message = "手机号格式不合法")
    private String mobile;

    /** 邮箱（用于找回密码） */
    @Excel(name = "邮箱", readConverterExp = "用=于找回密码")
    private String email;

//    /** 身份证号（实名认证用） */
//    @Excel(name = "身份证号", readConverterExp = "实=名认证用")
//    @NotNull(message = "身份证号不能为空")
//    @Pattern(regexp = "^[1-9]\\d{16}[\\dXx]$", message = "身份证号格式不正确")
//    private String idCard;

    /** 身份证号（实名认证用） */
    @Excel(name = "身份证号", readConverterExp = "实=名认证用")
    @Pattern(regexp = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)",
            message = "身份证号格式不合法")
    private String idCard;

    /** 头像URL */
    @Excel(name = "头像URL")
    private String avatar;

    /** 性别（0-男 1-女） */
    @Excel(name = "性别", readConverterExp = "0=-男,1=-女")
    private Long gender;

    /** 状态（0=正常 1=停用 2=未实名） */
    @Excel(name = "状态", readConverterExp = "0==正常,1==停用,2==未实名")
    private Long status;

    /** 逻辑删除（0=存在 1=删除） */
    @Excel(name = "逻辑删除", readConverterExp = "0==存在,1==删除")
    private Long delFlag;

    /** 最后登录IP */
    @Excel(name = "最后登录IP")
    private String loginIp;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date loginDate;

    /** 版本号（乐观锁控制） */
    @Excel(name = "版本号", readConverterExp = "乐=观锁控制")
    private Long version;

    /** 部门ID */
    private Long deptId;

    /** 用户ID */
    private Long userId;

    public void setGuestId(Long guestId) 
    {
        this.guestId = guestId;
    }

    public Long getGuestId() 
    {
        return guestId;
    }

    public void setOpenid(String openid) 
    {
        this.openid = openid;
    }

    public String getOpenid() 
    {
        return openid;
    }

    public void setUnionid(String unionid) 
    {
        this.unionid = unionid;
    }

    public String getUnionid() 
    {
        return unionid;
    }

    public void setRealName(String realName) 
    {
        this.realName = realName;
    }

    public String getRealName() 
    {
        return realName;
    }

    public void setMobile(String mobile) 
    {
        this.mobile = mobile;
    }

    public String getMobile() 
    {
        return mobile;
    }

    public void setEmail(String email) 
    {
        this.email = email;
    }

    public String getEmail() 
    {
        return email;
    }

    public void setIdCard(String idCard) 
    {
        this.idCard = idCard;
    }

    public String getIdCard() 
    {
        return idCard;
    }

    public void setAvatar(String avatar) 
    {
        this.avatar = avatar;
    }

    public String getAvatar() 
    {
        return avatar;
    }

    public void setGender(Long gender) 
    {
        this.gender = gender;
    }

    public Long getGender() 
    {
        return gender;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setDelFlag(Long delFlag) 
    {
        this.delFlag = delFlag;
    }

    public Long getDelFlag() 
    {
        return delFlag;
    }

    public void setLoginIp(String loginIp) 
    {
        this.loginIp = loginIp;
    }

    public String getLoginIp() 
    {
        return loginIp;
    }

    public void setLoginDate(Date loginDate) 
    {
        this.loginDate = loginDate;
    }

    public Date getLoginDate() 
    {
        return loginDate;
    }

    public void setVersion(Long version) 
    {
        this.version = version;
    }

    public Long getVersion() 
    {
        return version;
    }

    public void setDeptId(Long deptId) 
    {
        this.deptId = deptId;
    }

    public Long getDeptId() 
    {
        return deptId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("guestId", getGuestId())
            .append("openid", getOpenid())
            .append("unionid", getUnionid())
            .append("realName", getRealName())
            .append("mobile", getMobile())
            .append("email", getEmail())
            .append("idCard", getIdCard())
            .append("avatar", getAvatar())
            .append("gender", getGender())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("loginIp", getLoginIp())
            .append("loginDate", getLoginDate())
            .append("version", getVersion())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("remark", getRemark())
            .append("deptId", getDeptId())
            .append("userId", getUserId())
            .toString();
    }
}
